<%@ page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<form id="custForm" name="custForm" action="cardApprover-notApprove.htm" method="post">
<table width="722" border="0" cellpadding="0" cellspacing="0" class="bg2">
	<tr>
		<td width="100%" valign="top">
			<table width="100%" height="40" border="0" cellpadding="0" cellspacing="0">
				<tr>
					<td class="font02">ไม่ได้รับการอนุมัติ</td>
				</tr>
			</table>
			<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" class="font03">
				<tr>
					<td>โปรดระบุแจ้งเหตุผล
						เพื่อส่งอีเมล์ไปยังรายชื่อเจ้าของนามบัตร *</td>
				</tr>
			</table>
			<table width="600" height="130" border="0" align="center" cellpadding="0" cellspacing="0">
				<tr>
					<td height="30" align="center" class="font01_4">
						โปรดระบุแจ้งเหตุผลที่ไม่ได้รับการอนุมัติ
					</td>
				</tr>
				<tr>
					<td align="center">
						<label for="reason"></label>
						<textarea name="reason" class="form_field" id="reason"></textarea>
					</td>
				</tr>
			</table>
			<table width="700" height="290" border="0" align="center" cellpadding="0" cellspacing="0">
				<tr>
					<td align="center">
						<s:property value="%{pdfPath != null}"/>
						<s:if test="%{pdfPath != null}">
							<s:url var="pAdd" value="%{'/card/pdfs/pdfDispatch.htm'}" escapeAmp="false">
								<s:param name="name" value='%{pdfPath}' />
							</s:url>
							<iframe src="<s:property value="#pAdd"/>" style="width: 700; height: 240;" frameborder="0">
							</iframe>
						</s:if>
					</td>
				</tr>
			</table>
			<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
				<tr>
					<td align="center">
						<form>
							<a href="#"  onclick="back()" onMouseOut="MM_swapImgRestore()" sonMouseOver="MM_swapImage('Image5','','${request.imageBase}/b_back2.gif',1)">
								<img src="${request.imageBase}/b_back1.gif" title="ย้อนกลับ" width="126" height="33" id="Image5">
							</a> 
							<a href="#" onclick="notApprove()" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image6','','${request.imageBase}/b_confirm4.gif',1)">
								<img src="${request.imageBase}/b_confirm3.gif" title="ยืนยัน" width="126" height="33" id="Image6">
							</a>
							<!-- <a href="approved01.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image5','','${request.imageBase}/b_back2.gif',1)">reason</a> -->
						</form>
					</td>
				</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td>&nbsp;</td>
	</tr>
</table>
</form>
<script>
/*
	$j(document).ready(function(){
		TINY.scroller.init('scroll','scrollcontent','scrollbar','scroller','buttonclick');
	});
*/
	function back()
	{
		$j("#custForm").attr("action","cardApprover-back.htm");
		$j("#custForm").submit();
	}

	function notApprove()
	{
		var reason = $j("#reason").val();
		if("" == reason)
		{
			alert("กรุณาระบุเหตุผล ที่ไม่อนุมัติ");
			return false;
		}
		
		if(confirm('กรุณายืนยันการ ไม่อนุมัติ'))
		{
			$j("#custForm").attr("action","cardApprover-submitNotApprove.htm");
			$j("#custForm").submit();
		}
	}
</script>